<template>
  <!-- 杜 -->
  <!-- 商品标题下的灰色区域 -->
  <div class="service">
    <!-- 促销 -->
    <dl>
      <dt>促销</dt>
      <dd>12月好物放送，App领券购买直降120元</dd>
    </dl>
    <!-- 配送 -->
    <dl>
      <dt style="line-height: 30px">配送</dt>
      <dd style="display: flex">
        <span
          style="
            vertical-align: middle;
            padding-right: 5px;
            font-weight: normal;
            color: #666;
            line-height: 30px;
          "
          >至</span
        >
        <!-- 地区联动 -->
        <div class="linkage">
          <div class="city">
            <span class="value">北京市 市辖区 东城区</span>
            <i class="icondrop" ref="iconRef">></i>
          </div>
          <div class="option" v-show="false">
            <span>黑龙江</span>
          </div>
        </div>
      </dd>
    </dl>
    <!-- 服务 -->
    <div class="goods-service">
      <dt>服务</dt>
      <dd>
        <span>无忧退货</span>
        <span>快速退款</span>
        <span>免费包邮</span>
        <a href="/">了解详情</a>
      </dd>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const iconRef = ref();
// const rotate = () => {
//   console.log(iconRef.value);
//   iconRef.value.style.transform = 'rotate(-180deg)';
// };
</script>
<style scoped lang="less">
.service {
  background-color: #f5f5f5;
  width: 500px;
  padding: 20px 10px 0 10px;
  margin-top: 10px;
  dl {
    display: flex;
    padding-bottom: 20px;
    align-items: center;
    dt {
      width: 50px;
      color: #999;
    }
    dd {
      color: #666;
    }
  }
}
.linkage {
  vertical-align: middle;
  width: 145px;
  height: 30px;
  display: inline-block;
  z-index: 999;
  position: relative;
  .city {
    border: 1px solid #e4e4e4;
    height: 30px;
    padding: 0 5px;
    line-height: 28;
    cursor: pointer;
    overflow: hidden;
  }
  .value {
    color: black;
    z-index: 999;
    position: absolute;
    top: 1px;
    left: 0;
    font-size: 12px;
    color: #666;
    line-height: 28px;
    cursor: pointer;
    text-align: center;
    margin-left: 5px;
  }
  .icondrop {
    position: absolute;
    top: 0px;
    left: 281px;
    height: 100%;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transform: rotate(90deg);
  }
}
.goods-service {
  display: flex;
  padding-bottom: 20px;
  dt {
    width: 50px;
    color: #999;
  }
  dd {
    color: #666;
    span {
      margin-right: 10px;
    }
    span::before {
      content: '•';
      color: rgb(39, 186, 155);
      margin-right: 2px;
    }
    a {
      color: #27ba9b;
    }
  }
}
</style>
